package design.abstractfactory;

import design.factory.AbstractFactory;

/**
 * User: heihaier@xfuweng.com
 * Date: 2015/7/10
 * Time: 11:45
 */
public class FactoryProducter {

    public static AbstractFactory getFactory(String choice) {

        AbstractFactory factory = null;

        if ("shape".equalsIgnoreCase(choice)) {

            factory = new ShapeFactory();
        } else if ("color".equalsIgnoreCase(choice)) {

            factory = new ColorFactory();
        }

        return factory;
    }
}
